package com.cykj.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @BelongsProject: jd-project
 * @BelongsPackage: com.cykj.config
 * @Author: 小林
 * @CreateTime: 2025-02-26 16:53
 * @Description: RestTemplate配置类
 * @Version: 1.0
 */
@Configuration
public class RestTemplateConfig {
    @Bean
    @LoadBalanced //这个注解使用了具有负载均衡策略
    public RestTemplate restTemplate(RestTemplateBuilder builder) {
        return builder.build();
    }
}

